package com.draemoncode.weixindb.conventer;


import com.draemoncode.weixindb.constant.AutoMessageConstant;
import com.draemoncode.weixindb.domain.B_AutoMessage_Template;
import com.draemoncode.weixindb.mvc.vo.MessageTemplateVO;

import java.util.List;

public class BusiConventer {

    public static MessageTemplateVO toMessageTemplateVO(List<B_AutoMessage_Template> list){
        MessageTemplateVO result = new MessageTemplateVO();
        for (B_AutoMessage_Template b_autoMessage_template : list) {
            if(AutoMessageConstant.ZHUANG_JIA_TEMPLATE.equals(b_autoMessage_template.getFlag())){
                result.setShangZhuangMessage(b_autoMessage_template.getTemplate());
            }else if(AutoMessageConstant.CALULATE_TEMPLATE.equals(b_autoMessage_template.getFlag())){
                result.setCalculateMessage(b_autoMessage_template.getTemplate());
            }
        }
        return result;
    }
}
